var collectid='';
var t=0;
$(function(){
	//===================饭店的提示功能 start ==================
	
	$(".more-restaurant-table .restaurant-block").hover(function(){
		//================信息提示 start===========================
		
		var block=$(this);
		
		var dlg=$('#copy_dlg_restaurant');
		$('#copy_dlg_restaurant .detail').html(block.find(".line-hover-dlg").html());
		var u=block.offset().left+block.width()+5;
		var t=block.offset().top-10;
		var r=dlg.height();
		
		var s_top=90;
		//---------------------------
		if(u+360>$(window).width()) {
			
			u=block.offset().left-10-360;
			dlg.addClass("left").removeClass("right");
			if((t+20-r)<0){
				dlg.css({
					left:u,top:t+20
				}).show();
				$(".restaurant-hover-dlg .callout_tip").css("top", "20px");
			}else{
				dlg.css({
				left:u,top:t-r+s_top
				}).show();
				$(".restaurant-hover-dlg .callout_tip").css({
					top:r-60
				});
			}
			
			
		}else {
			dlg.addClass("right").removeClass("left");
			if((t+20-r)<0){
				dlg.css({
					left:u,top:t+20
				}).show();
				$(".restaurant-hover-dlg .callout_tip").css("top", "20px");
			}else{
				dlg.css({
				left:u,top:t-r+s_top
				}).show();
				$(".restaurant-hover-dlg .callout_tip").css({
					top:r-60
				});
			}
			
		}
		
		
		
		//===================信息提示 end====================================
		$(".favor-book>a.hover-add-favor",this).removeClass("hidden");
		$(".favor-book>a.hover-un-favor",this).removeClass("hidden");
		$(".status-desc",this).addClass("hidden");
	},function(){
		var dlg=$('#copy_dlg_restaurant');
		dlg.hide();
		
	 	$(".favor-book>a.hover-add-favor",this).addClass("hidden");
		$(".favor-book>a.hover-un-favor",this).addClass("hidden");
		$(".status-desc",this).removeClass("hidden");
		//$(this,".status-desc").removeClass("hidden");
	});
	//提示营业时间
	$('.deliver-time-wrapper').tooltip();
	//点击饭店进入最终页 
	//$(".more-restaurant-table .restaurant-block .line-one").click(function(){
	//	var select_p_obj=$(this).parent();
	//	var restant_id=select_p_obj.attr("rel");
	//	location.href="res.action?id="+restant_id;
	
	//});
	//
	$(".favor-book>a.hover-add-favor",this).click(function(){
		collectid = $(this).attr('rel');
		t=0;
		collectaaa();
	});
	$(".favor-book>a.hover-un-favor",this).click(function(){
		collectid = $(this).attr('rel');
		t=1;
		collectaaa();
	});
	//===================饭店的提示功能 end ==================
	
	
});
